
#判断
print("gashashh".isalpha())
print("123456".isdecimal())
print("gashsfh".startswith("g"))
print("gashsfh".endswith("h"))
#查找
print("gashsfha".count("a"))
print("gashsfh".index("a"))
print("gasdhah".find("a"))
print("gashsfhaf".rfind("a"))
print("gashsfhaf".replace("a","A"))
print("gashsfhaf".replace("a","A",1))
#切割
print("-------------------------- 切割&合并")
print("张三葬,王大拿,孙悟空".split("|")) # 如果split不写参数，会根据空格分隔
lst = ['张三葬', '王大拿', '孙悟空']
print("-".join(lst)) # 用-合并成字符串

print("-------------------------- 其他")
print(" \t abc  \t".strip()) # 去空白
print(" abc  ".strip())
print(" abc  ".upper())

# print("________________________________")
# print("as.gah".find("a"))
# print("as.gah".find("x"))
# print("as.gah".find("h"))
# print("ha.ha.good".rfind("."))
# print("ha.ha.good".replace("a","A"))
# print("ha.ha.good".replace("a","A",1))
# print("________________________________________")
# print("张三风|王大拿|孙悟空".split("-"))
# list1 = ["张三风","王大拿","孙悟空"]
# print("-".join(list1))
# print("________________________________________")
# print("b abc \t".strip())
# print(" abc ".strip())
# # print(" abc ".upper())
# string = "hell oworld"
# print(string.isalpha())text = "Hello, world!"

# # 检查字符串是否以 "world!" 结尾
# result = text.endswith("world!")
# print(result)  # 输出: True

# # 检查字符串是否以 "Hello" 结尾
# result = text.endswith


